package com.yjc.drygoods.member.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.yjc.common.to.CouponTo;
import com.yjc.common.utils.PageUtils;
import com.yjc.common.vo.MemberRespVo;
import com.yjc.drygoods.member.entity.MemberEntity;
import com.yjc.drygoods.member.exception.PhoneExitException;
import com.yjc.drygoods.member.exception.UserNameExitException;
import com.yjc.drygoods.member.vo.MemberLoginVo;
import com.yjc.drygoods.member.vo.MemberRegistVo;
import com.yjc.drygoods.member.vo.SocialVo;

import java.util.List;
import java.util.Map;

/**
 * 会员
 *
 * @author yjc
 * @email yjc19979401754@126.com
 * @date 2022-08-19 23:16:26
 */
public interface MemberService extends IService<MemberEntity> {

    PageUtils queryPage(Map<String, Object> params);

    void registMember(MemberRegistVo memberRegistVo);

    void checkUserNameOnly(String userName) throws UserNameExitException;

    void checkPhoneOnly(String phone) throws PhoneExitException;

    MemberEntity loginMember(MemberLoginVo memberLoginVo);

    MemberEntity weiboLogin(SocialVo socialVo);

    /**
     * 保存优惠券
     * @param coupon
     */
    void saveCoupon(CouponTo coupon) throws Exception;

    /**
     * 同时更新redis和mysql中的数据
     *
     * @param member
     */
    MemberEntity updateMemberMySqlAndRedisById(MemberEntity member);

    MemberRespVo clearSocial();

    List<MemberEntity> getAllMemberInfo();
}

